﻿@model IEnumerable<Citi.PTSConsolidation.WebUi.Models.ProgramModel>
@{
    ViewBag.Title = "Exceptions";
}
@using (Html.BeginForm())
{
    <h2>
        Exceptions</h2>
    
    if (Model != null && Model.Any())
    {
    <table class="table table-bordered table-striped">
        <tr>
            <th>
                Program Id
            </th>
            <th>
                Program Name
            </th>
            <th>
                Program Investment Alignment Category
            </th>
            <th>
                Key Business Contact
            </th>
            <th>
                Technology Program Manager
            </th>
            <th>
                TechProgram Manager SMT
            </th>
            <th>
                Tech Program Manager STLT
            </th>
            <th>
                Program Business Relationship
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Id)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ProgramName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ProgramInvestmentAlignmentCategory)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.KeyBusinessContact)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.TechnologyProgramManager)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.TechProgramManagerSMT)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.TechProgramManagerSTLT)
                </td>
                <td>
                    @Html.TextBox(string.Concat("ProgramOwner", item.Id), string.Empty, new { maxlength = 300 })
                </td>
            </tr>
        }
    </table>
    <input type="submit" value="Save all" class="btn btn-primary" />
    }
    else
    {
        <p>
            @Ajax.ActionLink("Regenerate Report", "ScheduleRoutine", "Scheduler", new { routineId = 135 },
                new AjaxOptions { OnComplete = "alert('Report generation was set!')" },
                new { @class = "btn btn-primary" })
        </p>
    
        <p>There's no program without 'Program Business Relashionship' information</p>
    }
}